<?php
class SendInfoTemplateServer {
	public function paging($numberEachPage = 10){
		$count = HttpDaoManager::getSendInfoTemplateDao()->count();
		$page = new Page($count, $numberEachPage);
		$limit[0]= $page->which;
		$limit[1]=$numberEachPage;
		$list = HttpDaoManager::getSendInfoTemplateDao()->getList($limit);
		$page1= $page->returnPage("?".ClassManager::getToos()->combinationGet('page')."&page=");
		$data['list'] =$list;
		$data['page'] = $page1;
		return $data;
	}
	public function deleteBatchByid($id){
		if (is_array($id)){
			$id = implode(',',$id);
		}
		HttpDaoManager::getSendInfoTemplateDao()->deleteBatchByid($id);
	}
	public function getTitleAndContent($info){
		if ($info['template']!=0){
			$tmp = HttpDaoManager::getSendInfoTemplateDao()->get($info['template']);
			$info['title'] = $tmp['title'];
			$info['content'] = $tmp['content'];
		}
		if (empty($info['title'])){
			return ERROR_CODE_TWO;
		}
		if (empty($info['content'])){
			return ERROR_CODE_THREE;
		}
		return $info;
	}
}

?>